import { http } from '@/utils/http/axios';
export function listPosts() {
  return http.request({
    url: '/admin/post/list',
    method: 'get',
  });
}

export function fetchList(query) {
  return http.request({
    url: '/admin/post/page',
    method: 'get',
    params: query,
  });
}

export function addObj(obj) {
  return http.request({
    url: '/admin/post',
    method: 'post',
    data: obj,
  });
}

export function getObj(id) {
  return http.request({
    url: '/admin/post/' + id,
    method: 'get',
  });
}

export function delObj(id) {
  return http.request({
    url: '/admin/post/' + id,
    method: 'delete',
  });
}

export function putObj(obj) {
  return http.request({
    url: '/admin/post',
    method: 'put',
    data: obj,
  });
}
